home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1998 February
/
Macworld (1998-02).dmg
/
Shareware World
/
Comms & Internet
/
AutoShare2.0
/
Samples
/
Scripts
/
Mikael Hansen
/
Script By Mail
/
Sample Script Text
< prev
next >
Wrap
Text File
|
1996-11-23
|
2KB
|
53 lines
-- ScriptServer returns a -2741 error (OSASyntaxTypeError: signaled when another
-- form of syntax was expected, e.g. "expected a <type> but found <this>".),
-- when the script to be compiled tries to use commands such as 'open for access
-- file' or 'load script file' (it may relate to the use of 'file'). The solution
-- is to put a 'tell application "Finder"' + 'end tell' block around the line in
-- question.
-- you MUST update these properties and the last line's password!
-- the path of the folder for additional scripts
property scriptPath: "disk:ScriptMail:"
-- the path and name of the file in the docs/autoshare folder
property resultPath: "disk:auto:docs:autoshare:"
property resultName: "Result"
-- the name and address of the person the return mail is sent to
property addressName: "ab"
property addressEmail: "a@b"
-- properties
property utilScript: "Utilities"
property resultFile: resultPath & resultName
property stringResult: ""
property listResult: {}
property myResult: {}
-- library routines
global myUtilities
tell application "Finder"
set myUtilities to load script file (scriptPath & utilScript)
end tell
-- issue a command to AutoShare
tell application "AutoShare.68k"
-- set strResult to (subscribe List "fun-l" Name "hi" Email "h@i")
set listResult to GetLists
end tell
-- In AppleScript, a list must be a list of more than one!
-- set myResult to {"---", stringResult, "---"}
set myResult to {"---"} & listResult & {"---"}
-- myResult MUST be a list of strings! Use another variable, if needed
tell myUtilities
WriteListToFile(resultFile,myResult)
end tell
-- return the result from the AutoShare command to the sender
tell application "AutoShare.68k"
File Mail Name addressName Email addressEmail Command resultName
end tell
-- keep the password as the first word in the last line
-- fun